package com.gitee.feizns.quickstart.quickio.example;

import com.github.artbits.quickio.api.JKV;
import com.github.artbits.quickio.core.Config;
import com.github.artbits.quickio.core.QuickIO;

/**
 * @author feizns
 * @since 2025/2/13
 */
public class KvExample {

    public static void main(String[] args) {
        Config cnf = Config.of(config -> {
            config.name("tmp");
            config.path("d:/tmp/kv-test");
        });
        try(JKV kv = QuickIO.kv(cnf)) {
//            kv.set("Pi", 3.14);
//            kv.set(3.14, "Pi");

            double d = kv.get("Pi", Double.class);
            String s = kv.get(3.14, String.class);
            QuickIO.println("%s = %f", s, d);
        };
    }

}
